﻿namespace _10000maxprimenumber
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int Num = Convert.ToInt32(Console.ReadLine());
            int i, j;
            bool Test;
            int Ans;
            DateTime Start, End;
            Start= DateTime.Now;
            for ( i = Num; i >= 2; i--) ;
            {
                Test=true;
                Ans = i;
                for( j=2;j<Math.Sqrt(Ans);j++)
                {
                    if(Ans%j == 0)
                    {
                        Test = false;
                        break;
                    }
                }
                if(Test == true)
                {
                    Console.WriteLine($"Max Prime Number is {Ans}");
                }
            }
            End = DateTime.Now;
            double Duration = (End - Start).TotalSeconds;
            Console.WriteLine($"Runs for{Duration.ToString()}seconds");
        }
    }
}